package com.bw.module_mine

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.alibaba.android.arouter.facade.annotation.Route
import com.bawei.lib_common.Router
import com.bw.lib_common.livedata_eventbus.Events
import com.bw.lib_common.livedata_eventbus.LiveDataEventBus
import com.bw.lib_common.livedata_eventbuss.LiveEventBus

@Route(path = Router.Ui.MineFragment)
class MineFragment : Fragment() {


    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the layout for this fragment
       val view =  inflater.inflate(R.layout.fragment_mine, container, false)
        view.findViewById<TextView>(R.id.tv).setOnClickListener {
            //发送全局事件
//            LiveDataEventBus.postEvent(Events.EVENT_LOGOUT, true)
//            LiveDataEventBus.postEvent(Events.EVENT_LOGIN_SUCCESS, true)
            // 发送非粘性事件
            LiveEventBus.with<Boolean>(Events.EVENT_LOGOUT,false).post(true)
            // 发送粘性事件
            LiveEventBus.with<Boolean>(Events.EVENT_LOGIN_SUCCESS, true).post(true)
        }

        return view
    }


}